package logic

import (
	"context"
	"onerk4/zk2/common/proto/user"
	"onerk4/zk2/service/server"
)

type UserServer struct {
	user.UnimplementedUserServer
}

func (s UserServer) Login(ctx context.Context, req *user.LoginRequest) (*user.LoginResponse, error) {
	login, err := server.Login(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s UserServer) CourseList(ctx context.Context, req *user.CourseListRequest) (*user.CourseListResponse, error) {
	login, err := server.CourseList(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s UserServer) CourseInfo(ctx context.Context, req *user.CourseInfoRequest) (*user.CourseInfoResponse, error) {
	login, err := server.CourseInfo(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s UserServer) ReservationCourse(ctx context.Context, req *user.ReservationCourseRequest) (*user.ReservationCourseResponse, error) {
	login, err := server.ReservationCourse(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s UserServer) QueryReservationCourse(ctx context.Context, req *user.QueryReservationCourseRequest) (*user.QueryReservationCourseResponse, error) {
	login, err := server.QueryReservationCourse(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s UserServer) QueryReservationCourseInfo(ctx context.Context, req *user.QueryReservationCourseRequestInfoRequest) (*user.QueryReservationCourseResponseInfoResponse, error) {
	login, err := server.QueryReservationCourseInfo(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s UserServer) DelQueryReservation(ctx context.Context, req *user.DelQueryReservationRequest) (*user.DelQueryReservationResponse, error) {
	login, err := server.DelQueryReservation(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}
